]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
keyboard: Ensure minimum height of the OSK always fits on screen
authorSebastian Keller <skeller@gnome.org>
Thu, 26 Mar 2026 18:29:44 +0000 (19:29 +0100)
committerSebastian Keller <skeller@gnome.org>
Thu, 26 Mar 2026 18:29:44 +0000 (19:29 +0100)
At very low resolutions, 1/3 of the screen height might not be enough
for the minimum height of the OSK, causing some keys to get pushed out
of the screen. This now ensures the height is always at least the
minimum height, but only up to 1/2 of the screen to avoid situations
where the OSK would cover the whole screen preventing any other
interaction.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/9126
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/4156>

js/ui/keyboard.js

index 644409e351048e54e048b700cc8512862787ca1e..e2d12a155fbd7bd94e6a891131a0a029779876d7 100644 (file)
@@ -1623,6 +1623,7 @@ export const Keyboard = GObject.registerClass({
 
     _relayout() {
         const monitor = Main.layoutManager.keyboardMonitor;
+        const [minHeight] = this.get_preferred_height(-1);
 
         if (!monitor)
             return;
@@ -1633,6 +1634,8 @@ export const Keyboard = GObject.registerClass({
             this.height = monitor.height / 3;
         else
             this.height = monitor.height / 4;
+
+        this.height = Math.clamp(this.height, minHeight, monitor.height / 2);
     }
 
     _updateKeys() {